<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="com.bci.pwtz.common.util.JsonUtils"%>
<%@page import="com.bci.pwtz.mysql.model.DictionaryType"%>
<%@page import="com.bci.pwtz.admin.service.impl.AdminDictionaryServiceImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/admin/common.jsp"%>
<%
AdminDictionaryServiceImpl service =  (AdminDictionaryServiceImpl)SpringUtil.getBean("adminDictionaryService");
List<DictionaryType> deviceType =  service.selectDictionaryTypeByRoot();
List<DictionaryType> dictionaryType =  service.selectDictionaryTypeByParent(null);
pageContext.setAttribute("deviceType",deviceType);
pageContext.setAttribute("dictionaryType",dictionaryType);
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>配网数据-字典管理</title>
<link href="<%=basePath %>admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>admin/css/llcss.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=basePath %>js/jquery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=basePath %>admin/js/common.js"></script>
<script type="text/javascript" src="<%=basePath %>admin/js/hd_ll.js"></script>
<script type="text/javascript" src="<%=basePath %>js/ajaxfileupload.js"></script>
<script type="text/javascript" src="<%=basePath %>admin/m/js/dictionarylist.js"></script>
<script>
	var dictionaryType = <%=JsonUtils.bean2json(PwtzConstants.DICTIONARY_TYPE)%>;
	var deviceType = <%=JsonUtils.bean2json(PwtzConstants.DEVICE_TYPE_MAP)%>;
</script>
</head>
<body bgcolor="white">
<div id="approveBox" class="add_members_box" style="display: none">
	<div class="add_members_box_title">
		审核
		<img src="<%=basePath %>user/images/add_members_close.jpg" alt="" class="close" />
	</div>
	<div class="info_revise" style="padding-bottom:0px">
		<input id="dictionaryId_approve" type="hidden" />
		<ul>
			<li><span>字典类型：</span>
				<label id="dictionaryTypeName_approve"></label>
			</li>
			<li><span>数据：</span>
				<label id="dictionaryValue_approve"></label>
			</li>
			<li><span>创建者：</span>
				<label id="createor_approve"></label>
			</li>
		</ul>
	</div>
    <div class="complete_box_submit">
    	<input class="complete_submit" style="margin-left: 15px" type="button" onclick="approve(1);" value="通 过" />
    	<input class="complete_submit" style="margin-left: 15px" type="button" onclick="approve(2);" value="拒 绝" />
    </div>
</div>
<div id="addBox" class="add_members_box" style="display: none">
	<div class="add_members_box_title">
		添加字典
		<img src="<%=basePath %>user/images/add_members_close.jpg" alt="" class="close" />
	</div>
	<form name="addForm" id="addForm">
	<div class="info_revise pwsj_czrz_choose" style="padding-bottom:0px">
		<ul>
			<li><span>设备类型：</span>
				<select style="width: 250px" id="deviceType_add" class="select_down">
					<c:forEach items="${deviceType }" var="bean">
						<option value="${bean.dictionaryTypeId }">${bean.typeName }</option>
					</c:forEach>
				</select>
			</li>
			<li><span>字典类型：</span>
				<select style="width: 250px" id="dictionaryType_add" name="dictionaryTypeId" class="select_down">
					
				</select>
			</li>
			<li><span>数据：</span>
				<input type="text" name="dictionaryValue" class="user_name" maxlength="20" style="width: 250px" value="" />
			</li>
		</ul>
	</div>
	</form>
    <div class="complete_box_submit"><input class="complete_submit" type="button" onclick="addDictionary();" value="完 成" /></div>
</div>
<div id="updateBox" class="add_members_box" style="display: none">
	<div class="add_members_box_title">
		修改字典
		<img src="<%=basePath %>user/images/add_members_close.jpg" alt="" class="close" />
	</div>
	<form name="updateForm" id="updateForm">
	<input type="hidden" name="dictionaryId" />
	<div class="info_revise" style="padding-bottom:0px">
		<ul>
			<li><span>设备类型：</span>
				<input class="user_name" type="text" readonly="readonly" name="deviceName"/>
			</li>
			<li><span>字典类型：</span>
				<input class="user_name" type="text" readonly="readonly" name="dictionaryTypeName"/>
			</li>
			<li><span>数据：</span>
				<input type="text" name="dictionaryValue" class="user_name" maxlength="20" value="" />
			</li>
		</ul>
	</div>
	</form>
    <div class="complete_box_submit"><input class="complete_submit" type="button" onclick="updateDictionary();" value="完 成" /></div>
</div>
	<%@ include file="/admin/head.jsp"%>
	<div class="pwsj_cont_box">
		<%@ include file="/admin/left.jsp"%>
		<div class="pwsj_cont_right_box">
		<div class="members_manage">
			<div class="pwsj_right_czrz_title" style="margin-bottom:3px">字典管理</div>
			<div class="pwsj_czrz_choose">
				<select id="deviceType" class="select_down">
					<option value="0">设备类型</option>
					<c:forEach items="${deviceType }" var="bean">
						<option value="${bean.dictionaryTypeId }">${bean.typeName }</option>
					</c:forEach>
				</select>
				<select id="dictionaryType" class="select_down">
					<option value="0">字典类型</option>
					<c:forEach items="${dictionaryType }" var="bean">
						<option value="${bean.dictionaryTypeId }">${bean.typeName }</option>
					</c:forEach>
				</select>
				<select id="status" class="select_down">
					<option value="0">状态</option>
					<option value="1">审核通过</option>
					<option value="2">待审核</option>
					
				</select>
				<input type="button" value="查 询" onclick="goToPage(1);" class="submit"/>
			</div>
			<div class="add_member" onclick="addShow();" style="float: left;">添加字典</div>
			<div class="clear"></div>
			<div class="pwsj_right_czrz_cont_title">
				<ul class="czrz_title_ul">
					<li class="number" style="width: 5%">序号</li>
					<li class="time" style="width: 25%">设备类型</li>
					<li class="time" style="width: 25%">字典类型</li>
					<li class="time" style="width: 25%">数据</li>
					<!-- <li class="operation" style="width: 10%">状态</li> -->
					<li class="username" style="width: 20%">操作</li>
				</ul>				
			</div>
			<div id="content">
			</div>
		</div>
		<!-- 分页_begin -->
		<div class="page">
	            <a href="#">首页</a>
	            <a href="#">上一页</a>
	            <a class="intro" href="#">1</a>
	            <a href="#">下一页</a>
	            <a href="#">末页</a>
	    </div>
	    <!-- 分页_end -->
		</div>
		<!--main_right end-->
		<div class="clear"></div>
	</div>
	<!--main end-->
	<%@ include file="/user/foot.jsp"%>
</body>
</html>